package org.dromara.system.mapper;

import org.apache.ibatis.annotations.Param;
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
import org.dromara.system.domain.DeviceAlarm;
import org.dromara.system.domain.dto.AlarmDeviceDto;
import org.dromara.system.domain.vo.DeviceAlarmVo;

import java.util.Collection;
import java.util.Date;
import java.util.List;

/**
 * 设备报警Mapper接口
 *
 * @author Lion Li
 * @date 2024-10-21
 */
public interface DeviceAlarmMapper extends BaseMapperPlus<DeviceAlarm, DeviceAlarmVo> {

    List<DeviceAlarmVo> getAlarmListByDeviceId(Long id);

    int getAlarm(Long id);

    int getAlarmCount(@Param("userId") Long userId);

    String selectDeviceGroupNameById(@Param("deviceGroup") Long deviceGroup);

    DeviceAlarm selectInfoById(Long id);

    Boolean updateAlarmDataById(@Param("id") Long id, @Param("transactor") String transactor, @Param("remark") String remark, @Param("date") Date date);

    Integer getAlarmCountByIds(@Param("ids") Collection<Long> deviceIds);

    List<AlarmDeviceDto> getAlarmDeviceListByIds(@Param("ids") Collection<Long> deviceIds);

    String getDeviceNameById(@Param("id") Long id);

    List<DeviceAlarmVo> selectLastList();

    Long getDeviceGroupNameByDeviceId(@Param("id") Long deviceId);

    Long getTunnelNameByDeviceId(@Param("id") Long deviceId);

    Long selectAlarmCount();
    Long selectAllCount();

    Long selectReportCount();

    Long selectRecoverCount();

    List<Long> selectAlarmIds(@Param("startOfDay") Date startOfDay,@Param("endOfDay") Date endOfDay);

    void updateDeviceStatusById(@Param("id") Long id);

    void updateVariableStatusById(@Param("id") Long id);

    Long selectNormalDeviceCount(@Param("deviceId") Long deviceId,@Param("status") int status);

    Long selectAllDeviceCount(@Param("deviceId") Long deviceId);

    Long selectAlarmDeviceCount(@Param("tunnelId") int tunnelId);

    void updateJobStatus(@Param("id") Long id);
}
